﻿using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SprayProcessSCADASystem.UserControls
{
    public partial class UserAlarmState : UIUserControl
    {
        public UserAlarmState()
        {
            InitializeComponent();
        }

        private string _deviceAlarmName = "报警名称";

        [Description("设置或获取设备报警名称")]
        [Category("自定义属性")]
        [Browsable(true)]
        public string DeviceAlarmName
        {
            get { return _deviceAlarmName; }
            set
            {
                _deviceAlarmName = value;
                this.lbl_AlarmName.Text = value;
            }
        }

        // 设备状态属性
        private bool _state = true;

        [Browsable(true)]
        [Category("自定义属性")]
        [Description("设置或获取设备报警的状态")]
        public bool State
        {
            get { return _state; }
            set
            {
                _state = value;
                if (_state)
                {
                    this.lbl_AlarmState.SymbolColor = Color.Red;
                }
                else
                {
                    this.lbl_AlarmState.SymbolColor = Color.LimeGreen;
                }
            }
        }


        private string _variableName = "";
        [Browsable(true)]
        [Category("自定义属性")]
        [Description("获取变量名称")]
        public string VariableName
        {
            get { return _variableName; }
            set { _variableName = value; }
        }
    }
}
